echo "正在上传安装包到蓝揍...";

version=$(grep "version:" pubspec.yaml | awk '{print $2}' | sed 's/["'\'']//g')

echo "当前在上传版本"$version"。";

curl --progress-bar --location 'https://up.woozooo.com/html5up.php' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9,zh;q=0.8' \
--header 'Connection: keep-alive' \
--header 'Cookie: PHPSESSID=n3v98pdgav988j3kujvchif29e0jcnk0; __51cke__=; ylogin=1370426; phpdisk_info=BzJSYwFkVWkHMQZkD2NaCQVkUWVaClcxAzdVNlNmBTFWYgIwBmcCOFRgBWFeDVVrAmUBMwpjATNQZARiBjQANwdlUmcBMFVtBzMGbw9gWjgFY1FrWjRXNQMxVTZTYAVmVmICOQZtAj9UYwUxXjxVBgJjATQKYAFlUGUEZAYwADEHNVJmAWc%3D; uag=d1a3c186fa4ecb7fa66ad5d666673b71; tfstk=f4toiJqBisN_5qyKZnjSm2rziruAV7sC9BEd9MCEus5by6pU2BAHEI1RwplWtHf2t3KR2TLhLsve96KHdkXeLBM59YgvFLsCYfht6cpWFxRRYJKu4sP2hOqUaX_U9tICYfhYkk7SjMO9t2yIrKkcp92zYBWzuxXhdMrP8uz4gs6FY6RFatPVpOPzUzrUgf9L3_deNnksqNNj7dOpmTbqWLfqtEKfEw1wU3qUYAWlr1JPGfvLuv_HZaxxq56kudA5EBi_Vg7H83I24jPGOUB149xIQyfh-3scKEGuyCAD7ifyxAqO239y7w-ZOyJ50sSPCEcgVgpGigKlbcNP9EpMx9xIOmAMLdTFoHmu1sQ1LgkTuPWeuk6qpnzQRaWfn1iNmCL1o-RP2xD07F_PhTotnx4QRaWfn1HmnP81zt6rX; __tins__21412745=%7B%22sid%22%3A%201711898839066%2C%20%22vd%22%3A%201%2C%20%22expires%22%3A%201711900639066%7D; __51laig__=19; folder_id_c=9923772' \
--header 'Origin: https://up.woozooo.com' \
--header 'Referer: https://up.woozooo.com/mydisk.php?item=files&action=index&u=1370426' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-origin' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36' \
--header 'sec-ch-ua: "Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--form 'task="1"' \
--form 'vie="2"' \
--form 've="2"' \
--form 'id="WU_FILE_0"' \
--form 'name="1.2.2+122-app-release.apk"' \
--form 'type="application/vnd.android.package-archive"' \
--form 'lastModifiedDate="Sun Mar 31 2024 23:27:21 GMT+0800 (China Standard Time)"' \
--form 'size="92149506"' \
--form 'folder_id_bb_n="9923772"' \
--form 'upload_file=@"./build/app/outputs/flutter-apk/1.2.2+122-app-release.apk"'


echo "";
echo "
IDO168-App-"$version"发布到蓝揍啦。
-------------------
【蒲公英-链接内永远保持最新版-每天只有1千次下载次数】
https://www.pgyer.com/"$appShortcutUrl"

【蓝揍网盘-如果里面没有当前版本包就是忘记上传了-无限次下载机会】
https://wwf.lanzoul.com/s/lianbao";
echo "";
